export default {
    namespaced: true,
    state: {
        user: {
            token: "",
            role: "",
        },
        isLogin: false
    },
    mutations: {
        userStatus(state, flag) {
            state.isLogin = flag
        },
        userToken(state, data) {
            state.user = data
        }
    },
    actions: {
        async setLoginStatus({commit}, flag) {
            commit('userStatus', flag)
        },
        async setToken({commit}, data) {
            commit('userToken', data)
        }
    }
}
